@steedos/service-plugin-amis 3.0.0-beta.105 → 3.0.0-beta.108
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.
|
@@ -30,10 +30,7 @@ const draftsApiAdaptor = `
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
var instance = payload.inserts[0];
|
|
33
|
-
var url = Steedos.absoluteUrl("/app/" +
|
|
34
|
-
// 这里不可以直接openWindow,因为手机浏览器上打不开新窗口,迁移到下面的afterDrafts脚本中,在custom动作单独执行openWindow才行
|
|
35
|
-
// Steedos.openWindow(url);
|
|
36
|
-
// if(!Steedos.isMobile()){ FlowRouter.reload();}
|
|
33
|
+
var url = Steedos.absoluteUrl("/app/" + context.app_id + "/instances/view/" + instance._id + "?display=" + (Steedos.Page.getDisplay('instances') || '') + "&side_object=instances&side_listview_id=draft");
|
|
37
34
|
payload.draftUrl = url;
|
|
38
35
|
return payload;
|
|
39
36
|
`;
|
|
@@ -41,7 +38,7 @@ const draftsApiAdaptor = `
|
|
|
41
38
|
const afterDrafts = `
|
|
42
39
|
var url = event.data.draftUrl;
|
|
43
40
|
Steedos.openWindow(url);
|
|
44
|
-
|
|
41
|
+
window.navigate(0);
|
|
45
42
|
`;
|
|
46
43
|
|
|
47
44
|
amisLib.registerAction('steedos_actions_standard_approve', {
|
|
@@ -49,7 +46,7 @@ amisLib.registerAction('steedos_actions_standard_approve', {
|
|
|
49
46
|
return amisLib.runActions([
|
|
50
47
|
{
|
|
51
48
|
"actionType": "custom",
|
|
52
|
-
"script": "var objectName = event.data.objectName || event.data.object_name;const flows = lodash.filter(
|
|
49
|
+
"script": "var objectName = event.data.objectName || event.data.object_name;const flows = lodash.filter(Steedos.object_workflows, (item) => { return item.object_name == objectName && (!item.sync_direction || item.sync_direction == 'both' || item.sync_direction == 'obj_to_ins') })\n\nevent.setData({ ...event.data, ...{ flows: flows, flowCount: flows.length } })\n\n"
|
|
53
50
|
},
|
|
54
51
|
{
|
|
55
52
|
"actionType": "ajax",
|
|
@@ -132,7 +129,7 @@ amisLib.registerAction('steedos_actions_standard_approve', {
|
|
|
132
129
|
"url": "${context.rootUrl}/api/object/workflow/drafts",
|
|
133
130
|
"method": "post",
|
|
134
131
|
"requestAdaptor":"api.data = {\n \'Instances\': [{\n \'flow\': api.body.flowId,\n \'applicant\': api.body.context.userId,\n \'space\': api.body.context.tenantId,\n \'record_ids\': [{ o: api.body.objectName, ids: [api.body.recordId] }]\n }]\n}\n\nreturn api;",
|
|
135
|
-
"adaptor":"\nif (payload.error) { \n return {\n status: 2,\n msg: payload.error\n }\n}\nconst instance = payload.inserts[0];\nSteedos.openWindow(Steedos.absoluteUrl(\'/app/\' +
|
|
132
|
+
"adaptor":"\nif (payload.error) { \n return {\n status: 2,\n msg: payload.error\n }\n}\nconst instance = payload.inserts[0];\nSteedos.openWindow(Steedos.absoluteUrl(\'/app/\' + context.app_id + \'/instances/view/\' + instance._id + \'?display=\' + (Steedos.Page.getDisplay('instances') || '') + \'&side_object=instances&side_listview_id=draft\'))\nwindow.navigate(0);\nreturn payload;",
|
|
136
133
|
"messages": {},
|
|
137
134
|
"headers": {
|
|
138
135
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
@@ -146,7 +146,8 @@ const getDateTimeOperators = (lng)=>{
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
|
|
149
|
-
const getFieldOperators = (type, lng)=>{
|
|
149
|
+
const getFieldOperators = (type, lng, ctx = {})=>{
|
|
150
|
+
let { multiple } = ctx;
|
|
150
151
|
switch (type) {
|
|
151
152
|
case 'text':
|
|
152
153
|
return ['equal', 'not_equal', 'like', 'not_like', 'starts_with', 'ends_with']
|
|
@@ -162,6 +163,9 @@ const getFieldOperators = (type, lng)=>{
|
|
|
162
163
|
case 'lookup':
|
|
163
164
|
case 'master_detail':
|
|
164
165
|
case 'select':
|
|
166
|
+
if (multiple){
|
|
167
|
+
return ['select_any_in', 'select_not_any_in']
|
|
168
|
+
}
|
|
165
169
|
return [ 'select_equals', 'select_not_equals', 'select_any_in', 'select_not_any_in' ]
|
|
166
170
|
default:
|
|
167
171
|
return ;
|
|
@@ -169,7 +173,7 @@ const getFieldOperators = (type, lng)=>{
|
|
|
169
173
|
|
|
170
174
|
}
|
|
171
175
|
|
|
172
|
-
const getField = (objectName, fieldName, type, lng)=>{
|
|
176
|
+
const getField = (objectName, fieldName, type, lng, ctx = {})=>{
|
|
173
177
|
let field = null;
|
|
174
178
|
switch (type) {
|
|
175
179
|
case 'textarea':
|
|
@@ -219,7 +223,7 @@ const getField = (objectName, fieldName, type, lng)=>{
|
|
|
219
223
|
case 'master_detail':
|
|
220
224
|
field = {
|
|
221
225
|
type: 'text',
|
|
222
|
-
operators: getFieldOperators("select", lng)
|
|
226
|
+
operators: getFieldOperators("select", lng, ctx)
|
|
223
227
|
};
|
|
224
228
|
break;
|
|
225
229
|
case 'select':
|
|
@@ -235,7 +239,7 @@ const getField = (objectName, fieldName, type, lng)=>{
|
|
|
235
239
|
}
|
|
236
240
|
,
|
|
237
241
|
searchable: true,
|
|
238
|
-
operators: getFieldOperators("select", lng)
|
|
242
|
+
operators: getFieldOperators("select", lng, ctx)
|
|
239
243
|
};
|
|
240
244
|
break;
|
|
241
245
|
case 'boolean':
|
|
@@ -366,7 +370,7 @@ module.exports = {
|
|
|
366
370
|
fields.push({
|
|
367
371
|
label: field.label,
|
|
368
372
|
name: field.name,
|
|
369
|
-
...getField(objectName, field.name, field.type, lng)
|
|
373
|
+
...getField(objectName, field.name, field.type, lng, { multiple: field.multiple})
|
|
370
374
|
})
|
|
371
375
|
break;
|
|
372
376
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-plugin-amis",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.108",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "yarn build:tailwind-base && yarn build:tailwind",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"publishConfig": {
|
|
14
14
|
"access": "public"
|
|
15
15
|
},
|
|
16
|
-
"gitHead": "
|
|
16
|
+
"gitHead": "e32e7c64ee17d2b2c18e280d28f6869d74747a17",
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"tailwindcss": "^3.4.17"
|
|
19
19
|
}
|