@steedos/standard-object-database 2.2.55-beta.23 → 2.3.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.
|
@@ -94,6 +94,8 @@ fields:
|
|
|
94
94
|
options:
|
|
95
95
|
- label: Custom JavaScript
|
|
96
96
|
value: script
|
|
97
|
+
- label: Amis Action
|
|
98
|
+
value: amis_action
|
|
97
99
|
# - label: 打印模板(word)
|
|
98
100
|
# value: word-print
|
|
99
101
|
defaultValue: script
|
|
@@ -107,11 +109,19 @@ fields:
|
|
|
107
109
|
sort_no: 180
|
|
108
110
|
type: code
|
|
109
111
|
language: javascript
|
|
110
|
-
required: true
|
|
112
|
+
required: "{{formData.type != 'amis_action' ? true: false}}"
|
|
111
113
|
# omit: true
|
|
112
114
|
# hidden: true
|
|
113
115
|
is_wide: true
|
|
114
|
-
visible_on: "{{formData.type != '
|
|
116
|
+
visible_on: "{{formData.type != 'amis_action' ? true: false}}"
|
|
117
|
+
amis_actions:
|
|
118
|
+
label: Amis Actions
|
|
119
|
+
sort_no: 180
|
|
120
|
+
type: code
|
|
121
|
+
language: json
|
|
122
|
+
required: "{{formData.type == 'amis_action' ? true: false}}"
|
|
123
|
+
is_wide: true
|
|
124
|
+
visible_on: "{{formData.type == 'amis_action' ? true: false}}"
|
|
115
125
|
paging:
|
|
116
126
|
enabled: false
|
|
117
127
|
list_views:
|
|
@@ -15,5 +15,79 @@ module.exports = {
|
|
|
15
15
|
},
|
|
16
16
|
customizeVisible: function(object_name, record_id, record_permissions, record){
|
|
17
17
|
return Creator.baseObject.actions.standard_new.visible() && record.is_system;
|
|
18
|
+
},
|
|
19
|
+
standard_new: function (object_name, record_id, fields){
|
|
20
|
+
var object = Creator.getObject(object_name);
|
|
21
|
+
var gridName = this.action.gridName;
|
|
22
|
+
// var isRelated = this.action.isRelated;
|
|
23
|
+
var relatedFieldName = this.action.relatedFieldName;
|
|
24
|
+
var masterRecordId = this.action.masterRecordId;
|
|
25
|
+
var initialValues = this.action.initialValues
|
|
26
|
+
if(!initialValues){
|
|
27
|
+
initialValues = {};
|
|
28
|
+
initialValues[relatedFieldName] = masterRecordId
|
|
29
|
+
}
|
|
30
|
+
const appId = Session.get("app_id");
|
|
31
|
+
const page = Steedos.Page.getPage('form', appId, object_name);
|
|
32
|
+
const title = t('New') + ' ' + object.label;
|
|
33
|
+
if (page && page.schema) {
|
|
34
|
+
const options = {
|
|
35
|
+
gridName: gridName
|
|
36
|
+
};
|
|
37
|
+
const fullScreenProps = {
|
|
38
|
+
width: "unset",
|
|
39
|
+
style: {
|
|
40
|
+
top: "50px",
|
|
41
|
+
bottom: "50px",
|
|
42
|
+
left: "50px",
|
|
43
|
+
right: "50px",
|
|
44
|
+
padding: "0px",
|
|
45
|
+
margin: "0px",
|
|
46
|
+
width: "unset"
|
|
47
|
+
},
|
|
48
|
+
className: "absolute"
|
|
49
|
+
};
|
|
50
|
+
Steedos.Page.render(SteedosUI.Modal, page, Object.assign({}, options, {
|
|
51
|
+
appId: appId,
|
|
52
|
+
objectName: object_name,
|
|
53
|
+
title: title,
|
|
54
|
+
data: initialValues,
|
|
55
|
+
}), {
|
|
56
|
+
props: fullScreenProps
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
standard_edit: function (object_name, record_id, fields){
|
|
61
|
+
var object = Creator.getObject(object_name);
|
|
62
|
+
var gridName = this.action.gridName;
|
|
63
|
+
const appId = Session.get("app_id");
|
|
64
|
+
const page = Steedos.Page.getPage('form', appId, object_name, record_id);
|
|
65
|
+
const title = t('Edit') + ' ' + object.label;
|
|
66
|
+
if (page && page.schema) {
|
|
67
|
+
const options = {
|
|
68
|
+
gridName: gridName
|
|
69
|
+
};
|
|
70
|
+
const fullScreenProps = {
|
|
71
|
+
width: "unset",
|
|
72
|
+
style: {
|
|
73
|
+
top: "50px",
|
|
74
|
+
bottom: "50px",
|
|
75
|
+
left: "50px",
|
|
76
|
+
right: "50px",
|
|
77
|
+
padding: "0px",
|
|
78
|
+
margin: "0px",
|
|
79
|
+
width: "unset"
|
|
80
|
+
},
|
|
81
|
+
className: "absolute"
|
|
82
|
+
};
|
|
83
|
+
Steedos.Page.render(SteedosUI.Modal, page, Object.assign({}, options, {
|
|
84
|
+
appId: appId,
|
|
85
|
+
objectName: object_name,
|
|
86
|
+
title: title,
|
|
87
|
+
recordId: record_id
|
|
88
|
+
}), {
|
|
89
|
+
props: fullScreenProps
|
|
90
|
+
});
|
|
91
|
+
}
|
|
18
92
|
}
|
|
19
93
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: baozhoutao@steedos.com
|
|
3
|
+
* @Date: 2022-08-05 14:20:24
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2022-08-05 15:41:30
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
8
|
+
const express = require("express");
|
|
9
|
+
const router = express.Router();
|
|
10
|
+
const core = require('@steedos/core');
|
|
11
|
+
const objectql = require('@steedos/objectql');
|
|
12
|
+
|
|
13
|
+
router.post('/api/listview/filters', core.requireAuthentication, async function (req, res) {
|
|
14
|
+
const {id, filters} = req.body;
|
|
15
|
+
const record = await objectql.getObject('object_listviews').directUpdate(id, {filters: filters})
|
|
16
|
+
res.status(200).send(record);
|
|
17
|
+
});
|
|
18
|
+
exports.default = router;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-object-database",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-beta.11",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
"description": "steedos package",
|
|
13
13
|
"repository": {},
|
|
14
14
|
"license": "MIT",
|
|
15
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "bca3b97bce7221bce55cd941bd074cf512fec7cd"
|
|
16
16
|
}
|